<?php
class Myblog_Form_ChangePass extends Zend_Form
{
public $element =array(
'ViewHelper',
'Errors',
array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class'  => 'passrecInput')),
array('Label', array('tag' => 'td')),
array(array('row' => 'HtmlTag'), array('tag' => 'tr','style'=>'height:50px;vertical-align: top;font-size:14px;')),

);
public $buttons = array(
                'ViewHelper',
                 array(array('data' => 'HtmlTag'), array('tag' => 'td', 'class'  => 'element')),
                 array(array('label' => 'HtmlTag'), array('tag' => 'td',  'placement' => 'prepend')),
                 array(array('row' => 'HtmlTag'), array('tag' => 'tr'))
);
    public function init()
    {
        $this->setMethod('POST')
            ->setAction('/changepassword')
            ->setName('changePass')
            ->setAttrib('onsubmit','return check()')
            ->setDecorators(array(array('FormElements'),array('HtmlTag', array('tag' => 'table')),'Form'));

        $this->addElements(array(

              new Zend_Form_Element_Password('password', array(
                                                              'label'=>'Введите новый пароль:',
                                                              'required'=>'true',
                                                              'size'=>'20',
                                                              'style'=>'margin-bottom:26px',
                                                              'autocomplete'=>'off',
                                                              'decorators'=>$this->element,
                                                              'validators'=>array(array('NotEmpty'),
                                                                                  array('PassVerify'),
                                                                                  array('ConfirmPassword'),
                                                                                  array('StringLength',true,array(6,20))),
                                                              'filters'=>array(array('StripTags'),
                                                                               array('StringTrim')),
                                                               )),
              new Zend_Form_Element_Password('confirmpassword', array(
                                                                     'label'=>'Повторте пароль:',
                                                                     'required'=>'true',
                                                                     'size'=>'20',
                                                                     'autocomplete'=>'off',
                                                                     'style'=>'margin-bottom:26px',
                                                                     'decorators'=>$this->element,
                                                                     'validators'=>array(array('NotEmpty'),
                                                                                         array('PassVerify'),
                                                                                         array('StringLength',true,array(6,20)),
                                                                                         array('ConfirmPassword')),
                                                                     'filters'=>array(array('StripTags'),
                                                                                      array('StringTrim')),
                                                                )),
               $token = new Zend_Form_Element_Hidden('token'),
               $submit = new Zend_Form_Element_Submit('submit', array(
                                                     'label'=>'Продолжить',
                                                     'class'=>'btn ',
                                                     'style'=>'margin:10px 0',
                                                     'decorators'=>$this->buttons
                                                    )),
        ));
        $submit->removeDecorator('Label');
        $token->removeDecorator('Label');
    }
}
?>